'use strict';

const { resolve } = require("dns");
const { env } = require("process");

exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	const db=uniCloud.database();
	return new Promise((resolve,reject)=>{
		db.collection("BookInLib").orderBy(event.field,event.orderType).get().then(res=>{
			console.log(res);
			resolve(res)
		}).catch(err=>{
			reject(err)
		})
	})
};
